/*
 * Copyright (c) 2006, 2021, webrx.cn All rights reserved.
 *
 */
package cn.webrx;

import java.util.Random;
import java.util.stream.Stream;

/**
 * <p>Project: javaseapp - Switch1
 * <p>Powered by webrx On 2021-07-29 17:20:48
 * <p>Created by IntelliJ IDEA
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 16
 */
public class ForIn2 {
    public static void main(String[] args) {
       String ns = "李四,张三,王五,张三丰,李强";
        for (String s : ns.split(",")) {
            System.out.println(s);
        }
        System.out.println("------------------------------");
        String[] nnn = ns.split(",");
        Random rand = new Random();
        System.out.println(nnn[rand.nextInt(nnn.length)]);
    }
}
